#ifndef TOOLELEMENT_H
#define TOOLELEMENT_H
#include "EditorCamera.h"
#include "StompedReality/Core/GameAccess.h"
#include "StompedReality/Core/IGame.h"
#include "StompedReality/Core/Input/InputSystem.h"
#include "StomperLib/BaseLayout.h"
#include "StomperLib/ToolModel.h"
#include <Gwen/Events.h>
namespace StomperLib {

class ToolElement : public Gwen::Event::Handler, public StompedReality::GameAccess
{
 public:

  ToolElement( StomperLib::BaseLayout* layout, StompedReality::IGame* game,
               EditorCamera* camera ) : StompedReality::GameAccess( ), Gwen::Event::Handler( )
  {
    Model = layout->Model;
    m_Game = game;
    m_Camera = camera;
  }

  virtual ~ToolElement( )
  {
  }

  virtual void Draw( )  = 0;

  virtual bool Update( ) = 0;

  ToolModel* Model;
  int UpdateOrder;
  int DrawOrder;

  StompedReality::Input::InputSystem* GetInputSystem( )
  {
    return m_Game->InputSystem( );
  }

  StompedReality::Math::Vector2 GetMousePos( )
  {
    return m_Camera->TranslateToCameraSpace( GetInputSystem( )->GetMousePosition( ));
  }

 protected:

  EditorCamera* m_Camera;
};

}
#endif // ifndef TOOLELEMENT_H